package com.example.moduletwo.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ListView;

import com.example.baselibrary.activity.BaseNewActivity;
import com.example.baselibrary.bean.PublicViewHolder;
import com.example.moduletwo.R;
import com.example.moduletwo.adapter.TestFiveAdapter;
import com.example.moduletwo.bean.BeanFive;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sun.li on 2018/6/6.
 *
 * @author sun.li
 */

public class ModuleTwoMVPActivityListViewFive extends BaseNewActivity {

    private TestFiveAdapter testFiveAdapter;

    private List<BeanFive> list;

    private Context mContext;

    @Override
    protected int initLayoutRes() {
        return R.layout.activity_mvp_listview;
    }

    @Override
    protected PublicViewHolder initViewHolderObject() {
        return null;
    }

    @Override
    protected void baseOnClick(int viewId) {

    }

    @Override
    protected void initView(@Nullable Bundle bundle) {
        super.initView(bundle);
        mContext = this;
        list = new ArrayList<>();
        for (int i = 1; i <= 50; i++) {
            BeanFive beanFive = new BeanFive("item_five_1_"+i,"item_five_2_"+i);
            list.add(beanFive);
        }
        testFiveAdapter = new TestFiveAdapter(mContext,list);

        ListView lv_aml_listview = findViewById(R.id.lv_aml_listview);
        lv_aml_listview.setAdapter(testFiveAdapter);

    }
}
